package xyz.jcat.webflux.sucurity;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.server.WebFilterExchange;
import org.springframework.security.web.server.authentication.ServerAuthenticationSuccessHandler;
import reactor.core.publisher.Mono;
import xyz.jcat.common.web.Resp;

public class DefaultServerAuthenticationSuccessHandler implements ServerAuthenticationSuccessHandler {

    @Override
    public Mono<Void> onAuthenticationSuccess(WebFilterExchange webFilterExchange, Authentication authentication) {

        return ServerUtils.writeJson(webFilterExchange.getExchange(), Resp.ok("登录成功"));
    }
}
